import { createRouter, createWebHistory } from 'vue-router'
import Login from "../views/Login.vue"
import Home from "../views/Home.vue"

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: Login
    },
    {
      path: '/home',
      name: 'home',
      redirect: '/home/AAAShouYe',
      component: Home,
      children: [
        {
          path: 'huiyuanliebiao',
          name: 'huiyuanliebiao',
          component: () => import('../views/member-page/HuiYuanLieBiao.vue'),
          
        },
       
        {
          path: 'chongzhishezhi',
          name: 'chongzhishezhi',
          component: () => import('../views/member-page/ChongZhiSheZhi.vue')
        },
        {
          path: 'jifenshezhi',
          name: 'jifenshezhi',
          component: () => import('../views/member-page/JiFenSheZhi.vue')
        },
        {
          path: 'xiaofeijilu',
          name: 'xiaofeijilu',
          component: () => import('../views/member-page/XiaoFeiJiLu.vue')
        },
        {
          path: 'xiaofeixiangqing',
          name: 'xiaofeixiangqing',
          component: () => import('../views/member-page/XiaoFeiXiangQing.vue')
        },
        {
          path: 'chongzhijilu',
          name: 'chongzhijilu',
          component: () => import('../views/member-page/ChongZhiJiLu.vue')
        },
        {
          path: 'chongzhixiangqing',
          name: 'chongzhixiangqing',
          component: () => import('../views/member-page/ChongZhiXiangQing.vue')
        },

        //优惠券模块路由
        {
          path: 'youhuiquan',
          name: 'youhuiquanguanli',
          component: () => import('../views/YouHuiQuan.vue')
        },
        {
          path: 'cardlist',
          name: 'cardlist',
          component: () => import('../views/YouHuiQuan/CardList.vue')
        },
        {
          path: 'addcard',
          name: 'addcard',
          component: () => import('../views/YouHuiQuan/AddCard.vue')
        },
        {
          path: 'cardgetlist',
          name: 'cardgetlist',
          component: () => import('../views/YouHuiQuan/CardGetList.vue')
        },
        //商品管理模块路由
        {
          path: 'shangpinliebiao',
          name: 'shangpinliebiao',
          component: () => import('../views/ShangPinLieBiao.vue'),
        },
        {
          path: 'addsplb',
          name: 'addsplb',
          component: () => import('../views/AddSplb.vue')
        },
        {
          path: 'editsplb',
          name: 'editsplb',
          component: () => import('../views/EditSplb.vue')
        },
        {
          path: 'shangpinfenlei',
          name: 'shangpinfenlei',
          component: () => import('../views/ShangPinFenLei.vue')
        },
        //订单管理模块路由
        {
          path: 'shangpindingdan',
          name: 'shangpindingdan',
          component: () => import('../views/ShangPinDingDan.vue')
        },
        {
          path: 'kefangdingdan',
          name: 'kefangdingdan',
          component: () => import('../views/KeFangDingDan.vue')
        },
        {
          path: 'zhusujilu',
          name: 'zhusujilu',
          component: () => import('../views/ZhuSuJiLu.vue')
        },
        {
          path: 'kfvisit',
          name: 'kfvisit',
          component: () => import('../views/KFvisit.vue')
        },
        //客房管理模块路由
        {
          path: 'fangtaiguanli',
          name: 'fangtaiguanli',
          component: () => import('../views/FangTaiGuanLi.vue')
        },
        {
          path: 'fangxingguanli',
          name: 'fangxingguanli',
          component: () => import('../views/FangXingGuanLi.vue')
        },
        {
          path: 'fanghaoguanli',
          name: 'fanghaoguanli',
          component: () => import('../views/FangHaoGuanLi.vue')
        },
        {
          path:'tianjiafangxing',
          name:'tianjiafangxing',
          component:()=>import('../views/Tianjiafangxing.vue')
        },
        //投诉建议模块路由
        {
          path: 'tousujianyi',
          name: 'tousujianyi',
          component: () => import('../views/TouSuJianYi.vue')
        },
        //用户管理
        {
          path: 'guanliyuanliebiao',
          name: 'guanliyuanliebiao',
          component: () => import('../views/GuanLiYuanLieBiao.vue')
        },
        {
          path: 'jiaoseguanli',
          name: 'jiaoseguanli',
          component: () => import('../views/JiaoSeGuanLi.vue')
        },
        {
          path: 'juesetianjia',
          name: 'juesetianjia',
          component: () => import('../views/UserManage/Admin.vue'),
        },
        //设置模块路由
        {
          path: 'weixinshezhi',
          name: 'weixinshezhi',
          component: () => import('../views/WeiXinSheZhi.vue')
        },
        {
          path: 'jiudianshezhi',
          name: 'jiudianshezhi',
          component: () => import('../views/JiuDianSheZhi.vue')
        },
        {
          path: 'qitashezhi',
          name: 'qitashezhi',
          component: () => import('../views/QiTaSheZhi.vue')
        },
        //项目拓展
        {
          path:'tuozhan1',
          name:'tuozhan1',
          component:()=>import('../views/WuJiTuoZhan/TuoZhan1.vue')
        },
        {
          path:'tuozhan2',
          name:'tuozhan2',
          component:()=>import('../views/WuJiTuoZhan/TuoZhan2.vue')
        },
        {
          path:'tuozhan3',
          name:'tuozhan3',
          component:()=>import('../views/WuJiTuoZhan/TuoZhan3.vue')
        },
        {
          path:'tuozhan4',
          name:'tuozhan4',
          component:()=>import('../views/WuJiTuoZhan/TuoZhan4.vue')
        },
        {
          path:'tuozhan5',
          name:'tuozhan5',
          component:()=>import('../views/WuJiTuoZhan/TuoZhan5.vue')
        },
        {
          path:'tuozhan6',
          name:'tuozhan6',
          component:()=>import('../views/WuJiTuoZhan/TuoZhan6.vue')
        }, 
        
        //首页
        {
          path:'AAAShouYe',
          name:'AAAShouYe',
          component:()=>import('../views/AAAShouYe.vue')
        },

      ]
    }
  ]
})

export default router
